package cn.edu.nju.newsFeed;

import cn.edu.nju.R;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class NewsFeedItemCache {
	private View baseView;
	private ImageView avatarView;
	private TextView contentView;
	private TextView timeView;
	private ImageView previewImageView;
	private TextView commentsNumberView;
	private TextView likeNumberView;
	
	public NewsFeedItemCache(View view){
		this.baseView = view;
	}
	
	public ImageView getAvatarView(){
		if(avatarView == null){
			avatarView = (ImageView)baseView.findViewById(R.id.avatar);
		}
		return avatarView;
	}
	
	public TextView getContentView(){
		if(contentView == null){
			contentView = (TextView)baseView.findViewById(R.id.feed_item_text);
		}
		return contentView;
	}
	
	public TextView getCommentsNumberView(){
		if(commentsNumberView == null){
			commentsNumberView = (TextView)baseView.findViewById(R.id.comments_number_text);
		}
		return commentsNumberView;
	}
	
	public TextView getLikeNumberView(){
		if(likeNumberView == null){
			likeNumberView = (TextView)baseView.findViewById(R.id.like_number_text);
		}
		return likeNumberView;
	}
	
	public TextView getTimeView(){
		if(timeView == null){
			timeView = (TextView)baseView.findViewById(R.id.feed_time_text);
		}
		return timeView;
	}
	
	public ImageView getPreviewImageView(){
		if(previewImageView == null){
			previewImageView = (ImageView) baseView.findViewById(R.id.feed_item_image_preview);
		}
		return previewImageView;
	}
}
